<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>
<div id ="paper-list">
<h1> Here is about your "<%=@query%> " search results.</h1>
 <table cellpadding="5" cellspacing="0" width="80%">  
  <% for paper in @searchResults %>
  <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <td >
     <span class="list-title"> <%=h paper.title %></span><br />
     Author:<%=h paper.author %><br/>
     Publisher:<%=h paper.publisher %></br>
     ISBN:<%=h paper.ISBN %></br>
     PageInfo:<%=h paper.page_info %></br>
      </td>
      <td width="60%">
        Abstraction</br>
        <%= h(truncate(paper.abstract, 80)) %>
      </td>
      <td class="list-action">
        <%= link_to 'Detail', :action => 'show', :id => paper %>
        <%if session[:administrator_id]%>
        <%= link_to 'Edit', :action => 'edit', :id => paper %>
        <%= link_to 'Delete', { :action  => 'delete', :id => paper },
                                         :confirm => "Are you sure?",
                                         :method  => :post %>
        <% end%>  
      </td>
    <% end %>
  </table>
<%= link_to 'Previous page', { :page => @pages.current.previous, :query => @query} if @pages.current.previous %>
<%= pagination_links(@pages, :params => { :query=> @query }) %>
<%= link_to 'Next page', { :page => @pages.current.next, :query => @query} if @pages.current.next %>
<p>
<%= link_to 'Back', :action => 'list' %></td>
</p>
</div>
